version 19			       
set more off					
  quietly log					
  local logon = r(status)
  if "`logon'" == "on" { 		
	log close 
	}	
log using "CEDAW_ROCS_Dataset", text replace	
 use "CEDAW_ROCS_Dataset.dta" , clear
 
 *		****************************************************************	*/
/* 		Author:			Kreutzer                    						*/
/*		Due Date:		14 July 2024			    					    */
/*      File:			CEDAWROCS Do File.d		     		    			*/
/*		Purpose:		Replication                                         */
/*		************************************************************		*/

*Note 1: The dataset will be submitted as the CEDAWROCS Dataset. However, there are three figures in the research note that require using another dataset. That will be outlined below and is also shown in the READMEFile.* 

*Note 2: There are no models in this paper, all data is descriprive, so the outputs will only be figures and tables. Tables will be first in this file, followed by graphs and figures.*

********************************************************************************
*  									TABLES									   *
********************************************************************************

***********Table 1: Number of Country Year Reservations by Article************** 
tab art1
tab art2
tab art3
tab art4
tab art5
tab art6
tab art7
tab art8
tab art9
tab art10
tab art11
tab art12
tab art13
tab art14
tab art15
tab art16
tab art17
tab art18
tab art19
tab art20
tab art21
tab art22
tab art23
tab art24
tab art25
tab art26
tab art27
tab art28
tab art29

*put each output into table, and highlight countries with reservations number over 300*
********************************************************************************

************Table 2: Countries with Most Article Reservations*******************
tab ccode if art1==1 
tab ccode if art2==1
tab ccode if art3==1
tab ccode if art4==1
tab ccode if art5==1
tab ccode if art6==1
tab ccode if art7==1
tab ccode if art8==1
tab ccode if art9==1
tab ccode if art10==1
tab ccode if art11==1
tab ccode if art12==1
tab ccode if art13==1
tab ccode if art14==1
tab ccode if art15==1
tab ccode if art16==1
tab ccode if art17==1
tab ccode if art18==1
tab ccode if art19==1
tab ccode if art20==1
tab ccode if art21==1
tab ccode if art22==1
tab ccode if art23==1
tab ccode if art24==1
tab ccode if art25==1
tab ccode if art26==1
tab ccode if art27==1
tab ccode if art28==1
tab ccode if art29==1

*From each output I mark what countries have reservations on what articles, then I combine them in a table and mark how many total reservations they have.*
********************************************************************************

************Table 3: Countries with Most Article Objections********************* 
tab ccode if objection1==1
tab ccode if objection2==1
tab ccode if objection3==1
tab ccode if objection4==1
tab ccode if objection5==1
tab ccode if objection6==1
tab ccode if objection7==1
tab ccode if objection8==1
tab ccode if objection9==1
tab ccode if objection10==1
tab ccode if objection11==1
tab ccode if objection12==1

*From each output I mark what countries have objections, then I put into the table all countries that have 10 or more objections.*
********************************************************************************

*Table 4: State's Objections to CEDAW Reservations 

*To quickly pull together this information, I made new variables and new descriptions of the types of objections, as described in the codebook and Lab book.*

*Overall Dummy Objection Variable Created
gen objection=.
recode objection (.=1) if objection1 ==1
recode objection (.=1) if objection2 ==1
recode objection (.=1) if objection3 ==1
recode objection (.=1) if objection4 ==1
recode objection (.=1) if objection5 ==1
recode objection (.=1) if objection6 ==1
recode objection (.=1) if objection7 ==1
recode objection (.=1) if objection8 ==1
recode objection (.=1) if objection9 ==1
recode objection (.=1) if objection10 ==1
recode objection (.=1) if objection11 ==1
recode objection (.=1) if objection12 ==1
recode objection (.=0) if objection1 ==0
recode objection (.=0) if objection2 ==0
recode objection (.=0) if objection3 ==0
recode objection (.=0) if objection4 ==0
recode objection (.=0) if objection5 ==0
recode objection (.=0) if objection6 ==0
recode objection (.=0) if objection7 ==0
recode objection (.=0) if objection8 ==0
recode objection (.=0) if objection9 ==0
recode objection (.=0) if objection10 ==0
recode objection (.=0) if objection11 ==0
recode objection (.=0) if objection12 ==0

*Objection Type
*economic objection
gen economicobj=.
recode economicobj (.=1) if objart1_1==1 
recode economicobj (.=1) if objart1_2==1  
recode economicobj (.=1) if objart1_3==1  
recode economicobj (.=1) if objart1_4==1 
recode economicobj (.=1) if objart1_5==1  
recode economicobj (.=1) if objart1_6==1 
recode economicobj (.=1) if objart2_1==1 
recode economicobj (.=1) if objart2_2==1  
recode economicobj (.=1) if objart2_3==1  
recode economicobj (.=1) if objart2_4==1 
recode economicobj (.=1) if objart2_5==1  
recode economicobj (.=1) if objart3_1==1 
recode economicobj (.=1) if objart3_2==1  
recode economicobj (.=1) if objart3_3==1  
recode economicobj (.=1) if objart4_1==1 
recode economicobj (.=1) if objart4_2==1  
recode economicobj (.=1) if objart4_3==1 
recode economicobj (.=1) if objart5_1==1 
recode economicobj (.=1) if objart5_2==1  
recode economicobj (.=1) if objart5_3==1  
recode economicobj (.=1) if objart5_4==1 
recode economicobj (.=1) if objart6_1==1 
recode economicobj (.=1) if objart6_2==1
recode economicobj (.=1) if objart7_1==1 
recode economicobj (.=1) if objart7_2==1 
recode economicobj (.=1) if objart8_1==1 
recode economicobj (.=1) if objart8_2==1     
recode economicobj (.=1) if objart8_3==1 
recode economicobj (.=1) if objart9_1==1 
recode economicobj (.=1) if objart9_2==1     
recode economicobj (.=1) if objart9_3==1 
recode economicobj (.=1) if objart10_1==1 
recode economicobj (.=1) if objart10_2==1 
recode economicobj (.=1) if objart11_1==1 
recode economicobj (.=1) if objart12_1==1 
recode economicobj (.=0) if objection ==1

*political objection
gen politicalobj=.
recode politicalobj (.=1) if objart1_1==2 
recode politicalobj (.=1) if objart1_2==2  
recode politicalobj (.=1) if objart1_3==2  
recode politicalobj (.=1) if objart1_4==2 
recode politicalobj (.=1) if objart1_5==2  
recode politicalobj (.=1) if objart1_6==2 
recode politicalobj (.=1) if objart2_1==2 
recode politicalobj (.=1) if objart2_2==2  
recode politicalobj (.=1) if objart2_3==2  
recode politicalobj (.=1) if objart2_4==2 
recode politicalobj (.=1) if objart2_5==2  
recode politicalobj (.=1) if objart3_1==2 
recode politicalobj (.=1) if objart3_2==2  
recode politicalobj (.=1) if objart3_3==2  
recode politicalobj (.=1) if objart4_1==2 
recode politicalobj (.=1) if objart4_2==2  
recode politicalobj (.=1) if objart4_3==2 
recode politicalobj (.=1) if objart5_1==2 
recode politicalobj (.=1) if objart5_2==2  
recode politicalobj (.=1) if objart5_3==2  
recode politicalobj (.=1) if objart5_4==2 
recode politicalobj (.=1) if objart6_1==2 
recode politicalobj (.=1) if objart6_2==2
recode politicalobj (.=1) if objart7_1==2 
recode politicalobj (.=1) if objart7_2==2 
recode politicalobj (.=1) if objart8_1==2 
recode politicalobj (.=1) if objart8_2==2     
recode politicalobj (.=1) if objart8_3==2 
recode politicalobj (.=1) if objart9_1==2 
recode politicalobj (.=1) if objart9_2==2     
recode politicalobj (.=1) if objart9_3==2 
recode politicalobj (.=1) if objart10_1==2 
recode politicalobj (.=1) if objart10_2==2 
recode politicalobj (.=1) if objart11_1==2 
recode politicalobj (.=1) if objart12_1==2 
recode politicalobj (.=0) if objection == 1 

*social objection
gen socialobj=.
recode socialobj (.=1) if objart1_1==3 
recode socialobj (.=1) if objart1_2==3  
recode socialobj (.=1) if objart1_3==3  
recode socialobj (.=1) if objart1_4==3 
recode socialobj (.=1) if objart1_5==3  
recode socialobj (.=1) if objart1_6==3 
recode socialobj (.=1) if objart2_1==3 
recode socialobj (.=1) if objart2_2==3  
recode socialobj (.=1) if objart2_3==3  
recode socialobj (.=1) if objart2_4==3 
recode socialobj (.=1) if objart2_5==3  
recode socialobj (.=1) if objart3_1==3 
recode socialobj (.=1) if objart3_2==3  
recode socialobj (.=1) if objart3_3==3  
recode socialobj (.=1) if objart4_1==3 
recode socialobj (.=1) if objart4_2==3  
recode socialobj (.=1) if objart4_3==3 
recode socialobj (.=1) if objart5_1==3 
recode socialobj (.=1) if objart5_2==3  
recode socialobj (.=1) if objart5_3==3  
recode socialobj (.=1) if objart5_4==3 
recode socialobj (.=1) if objart6_1==3 
recode socialobj (.=1) if objart6_2==3
recode socialobj (.=1) if objart7_1==3 
recode socialobj (.=1) if objart7_2==3 
recode socialobj (.=1) if objart8_1==3 
recode socialobj (.=1) if objart8_2==3     
recode socialobj (.=1) if objart8_3==3 
recode socialobj (.=1) if objart9_1==3 
recode socialobj (.=1) if objart9_2==3     
recode socialobj (.=1) if objart9_3==3 
recode socialobj (.=1) if objart10_1==3 
recode socialobj (.=1) if objart10_2==3 
recode socialobj (.=1) if objart11_1==3 
recode socialobj (.=1) if objart12_1==3 
recode socialobj (.=0) if objection == 1 

*general objection 
gen generalobj=.
recode generalobj (.=1) if objart1_1==4 
recode generalobj (.=1) if objart1_2==4  
recode generalobj (.=1) if objart1_3==4  
recode generalobj (.=1) if objart1_4==4 
recode generalobj (.=1) if objart1_5==4  
recode generalobj (.=1) if objart1_6==4 
recode generalobj (.=1) if objart2_1==4 
recode generalobj (.=1) if objart2_2==4  
recode generalobj (.=1) if objart2_3==4  
recode generalobj (.=1) if objart2_4==4 
recode generalobj (.=1) if objart2_5==4  
recode generalobj (.=1) if objart3_1==4 
recode generalobj (.=1) if objart3_2==4  
recode generalobj (.=1) if objart3_3==4  
recode generalobj (.=1) if objart4_1==4 
recode generalobj (.=1) if objart4_2==4  
recode generalobj (.=1) if objart4_3==4 
recode generalobj (.=1) if objart5_1==4 
recode generalobj (.=1) if objart5_2==4  
recode generalobj (.=1) if objart5_3==4  
recode generalobj (.=1) if objart5_4==4 
recode generalobj (.=1) if objart6_1==4 
recode generalobj (.=1) if objart6_2==4
recode generalobj (.=1) if objart7_1==4 
recode generalobj (.=1) if objart7_2==4 
recode generalobj (.=1) if objart8_1==4 
recode generalobj (.=1) if objart8_2==4     
recode generalobj (.=1) if objart8_3==4 
recode generalobj (.=1) if objart9_1==4 
recode generalobj (.=1) if objart9_2==4     
recode generalobj (.=1) if objart9_3==4 
recode generalobj (.=1) if objart10_1==4 
recode generalobj (.=1) if objart10_2==4 
recode generalobj (.=1) if objart11_1==4 
recode generalobj (.=1) if objart12_1==4 
recode generalobj (.=0) if objection == 1 

*procedural objection 
gen proceduralobj=.
recode proceduralobj (.=1) if objart1_1==5 
recode proceduralobj (.=1) if objart1_2==5  
recode proceduralobj (.=1) if objart1_3==5  
recode proceduralobj (.=1) if objart1_4==5 
recode proceduralobj (.=1) if objart1_5==5  
recode proceduralobj (.=1) if objart1_6==5 
recode proceduralobj (.=1) if objart2_1==5 
recode proceduralobj (.=1) if objart2_2==5  
recode proceduralobj (.=1) if objart2_3==5  
recode proceduralobj (.=1) if objart2_4==5 
recode proceduralobj (.=1) if objart2_5==5  
recode proceduralobj (.=1) if objart3_1==5 
recode proceduralobj (.=1) if objart3_2==5  
recode proceduralobj (.=1) if objart3_3==5  
recode proceduralobj (.=1) if objart4_1==5 
recode proceduralobj (.=1) if objart4_2==5  
recode proceduralobj (.=1) if objart4_3==5 
recode proceduralobj (.=1) if objart5_1==5 
recode proceduralobj (.=1) if objart5_2==5  
recode proceduralobj (.=1) if objart5_3==5  
recode proceduralobj (.=1) if objart5_4==5 
recode proceduralobj (.=1) if objart6_1==5 
recode proceduralobj (.=1) if objart6_2==5
recode proceduralobj (.=1) if objart7_1==5 
recode proceduralobj (.=1) if objart7_2==5 
recode proceduralobj (.=1) if objart8_1==5 
recode proceduralobj (.=1) if objart8_2==5     
recode proceduralobj (.=1) if objart8_3==5 
recode proceduralobj (.=1) if objart9_1==5 
recode proceduralobj (.=1) if objart9_2==5     
recode proceduralobj (.=1) if objart9_3==5 
recode proceduralobj (.=1) if objart10_1==5 
recode proceduralobj (.=1) if objart10_2==5 
recode proceduralobj (.=1) if objart11_1==5 
recode proceduralobj (.=1) if objart12_1==5 
recode proceduralobj (.=0) if objection == 1 

*not specified 
gen notspecifiedobj=.
recode notspecifiedobj (.=1) if objart1_1==6 
recode notspecifiedobj (.=1) if objart1_2==6  
recode notspecifiedobj (.=1) if objart1_3==6  
recode notspecifiedobj (.=1) if objart1_4==6 
recode notspecifiedobj (.=1) if objart1_5==6  
recode notspecifiedobj (.=1) if objart1_6==6 
recode notspecifiedobj (.=1) if objart2_1==6 
recode notspecifiedobj (.=1) if objart2_2==6  
recode notspecifiedobj (.=1) if objart2_3==6  
recode notspecifiedobj (.=1) if objart2_4==6 
recode notspecifiedobj (.=1) if objart2_5==6  
recode notspecifiedobj (.=1) if objart3_1==6 
recode notspecifiedobj (.=1) if objart3_2==6  
recode notspecifiedobj (.=1) if objart3_3==6  
recode notspecifiedobj (.=1) if objart4_1==6 
recode notspecifiedobj (.=1) if objart4_2==6  
recode notspecifiedobj (.=1) if objart4_3==6 
recode notspecifiedobj (.=1) if objart5_1==6 
recode notspecifiedobj (.=1) if objart5_2==6  
recode notspecifiedobj (.=1) if objart5_3==6  
recode notspecifiedobj (.=1) if objart5_4==6 
recode notspecifiedobj (.=1) if objart6_1==6 
recode notspecifiedobj (.=1) if objart6_2==6
recode notspecifiedobj (.=1) if objart7_1==6 
recode notspecifiedobj (.=1) if objart7_2==6 
recode notspecifiedobj (.=1) if objart8_1==6 
recode notspecifiedobj (.=1) if objart8_2==6     
recode notspecifiedobj (.=1) if objart8_3==6 
recode notspecifiedobj (.=1) if objart9_1==6 
recode notspecifiedobj (.=1) if objart9_2==6     
recode notspecifiedobj (.=1) if objart9_3==6 
recode notspecifiedobj (.=1) if objart10_1==6 
recode notspecifiedobj (.=1) if objart10_2==6 
recode notspecifiedobj (.=1) if objart11_1==6 
recode notspecifiedobj (.=1) if objart12_1==6 
recode notspecifiedobj (.=0) if objection == 1 

tab politicalobj
tab economicobj
tab socialobj
tab proceduralobj
tab generalobj
tab notspecifiedobj
*Put each of the "type" outputs (ie. political, economic, social, etc.) each of these outputs into table*

********************************************************************************
*  									MAP										   *
********************************************************************************
*Set your working directory to have all the below files
*Open the WB_countries_Admin0_10m_ccode.dta file then run code below 

*Figure 1: Commitment to CEDAW Map 
 
use "WB_countries_Admin0_10m_ccode.dta"

merge m:m ccode using "CEDAW_Reservation_Removal_DataONLY2021.dta"

duplicates r _ID
duplicates drop _ID, force	

gen cedaw_commit=0
replace cedaw_commit=1 if ratified_with_reservations==1
replace cedaw_commit=2 if withdraw==1 
replace cedaw_commit=2 if partial==1
replace cedaw_commit=3 if fully_ratified==1 

* Getting rid of some of the random outlying islands and territories that shouldnt have distinct CEDAW commit values
replace cedaw_commit = . in 230
replace cedaw_commit = . in 231
replace cedaw_commit = . in 232
replace cedaw_commit = . in 233
replace cedaw_commit = . in 234
replace cedaw_commit = . in 235
replace cedaw_commit = . in 236
replace cedaw_commit = . in 237
replace cedaw_commit = . in 238
replace cedaw_commit = . in 239
replace cedaw_commit = . in 240
replace cedaw_commit = . in 241
replace cedaw_commit = . in 242
replace cedaw_commit = . in 243
replace cedaw_commit = . in 244
replace cedaw_commit = . in 245
replace cedaw_commit = . in 246
replace cedaw_commit = . in 247
replace cedaw_commit = . in 248
replace cedaw_commit = . in 249
replace cedaw_commit = . in 250
replace cedaw_commit = . in 251
replace cedaw_commit = . in 252
replace cedaw_commit = . in 20
replace cedaw_commit = . in 19
replace cedaw_commit = . in 18
replace cedaw_commit = . in 17
replace cedaw_commit = . in 16
replace cedaw_commit = . in 15
replace cedaw_commit = . in 14
replace cedaw_commit = . in 13
replace cedaw_commit = . in 12
replace cedaw_commit = . in 11
replace cedaw_commit = . in 10
replace cedaw_commit = . in 9
replace cedaw_commit = . in 8
replace cedaw_commit = . in 7
replace cedaw_commit = . in 6
replace cedaw_commit = . in 5
replace cedaw_commit = . in 4
replace cedaw_commit = . in 3
replace cedaw_commit = . in 2

*** Step 4: Map Using Following Command ***
grmap cedaw_commit using WB_countries_Admin0_10m_shp[1], id(_ID) fcolor(Blues) ///
      legstyle(1) legorder(hilo) clnumber(4) clmethod(unique) clbreaks(0 1 2 3) ///
      legtitle(CEDAW Commitment) ///
      title(Global Commitment to CEDAW (2021), size(large) color(black)) ///
      legend(size(medsmall) color(gray) bplacement(sw))
	
	
********************************************************************************
*  							      GRAPHS									   *
********************************************************************************	

*Open the CEDAW_CIRI_DATA_10232023 file then run code below 

*Figure 2: Women's Political Rights by CEDAW Commitment Levels
*Figure 3: Women's Social Rights by CEDAW Commitment Levels


*Aggregated time series plots
*Collapsing data by year
*Generating dataset for fully ratified states
use "CEDAW_CIRI_DATA_10232023.dta"
collapse (mean) WOPOL WOSOC WECON if fully_ratified==1, by (year)
rename WOPOL WOPOLFully
rename WOSOC WOSOCFully
rename WECON WECONFully
tsset year
save "fullyratifiedavg.dta"
clear

*Generating data for ratified with reservations states
use "CEDAW_CIRI_DATA_10232023.dta"
collapse (mean) WOPOL WOSOC WECON if ratified_with_reservations==1, by (year)
rename WOPOL WOPOLRes
rename WOSOC WOSOCRes
rename WECON WECONRes
tsset year
save "reservationsavg.dta"
clear

*Generating data for ratified with non CEDAW states
use "CEDAW_CIRI_DATA_10232023.dta"
collapse (mean) WOPOL WOSOC WECON if no_ratification==1, by (year)
rename WOPOL WOPOLNoRat
rename WOSOC WOSOCNoRat
rename WECON WECONNoRat
tsset year
save "noratavg.dta"
clear

*Merge 3 datasets
use "fullyratifiedavg.dta"
merge year using "reservationsavg.dta"
tab _merge
drop _merge
sort year
merge year using "noratavg.dta"
tab _merge
drop _merge
sort year
tsset year

label variable WOPOLNoRat "Not in CEDAW"
label variable WOPOLFully "CEDAW w/o Reservations"
label variable WOPOLRes "CEDAW with Reservations"
label variable WOSOCNoRat "Not in CEDAW"
label variable WOSOCFully "CEDAW w/o Reservations"
label variable WOSOCRes "CEDAW with Reservations"
label variable WECONFully "Cedaw w/o Reservations"
label variable WECONRes "Cedaw with Reservations"
label variable WECONNoRat "Not in CEDAW"

save "combinedtimeseries.dta"

*Figure 2
tsline WOPOLFully WOPOLRes WOPOLNoRat if year<2020
*Figure 3
tsline WOSOCFully WOSOCRes WOSOCNoRat if year<2022
*Figure 4 - APPENDIX - Figure 4: Women's Economic Rights by CEDAW Commitment Levels* 
tsline WECONFully WECONRes WECONNoRat if year<2020
